#ifndef TESTER_H
#define TESTER_H
//QT
#include <QWidget>
#include <QTimer>
#include <Log4Qt/logger.h>
#include <string>
//UI
#include "ui_tester.h"

//owed
#include "entity/marketprice.pb.h"
#include "ieventagent.h"
#include "messageargs.h"

class ConnectionManager;


class Tester : public QWidget, private Ui::TesterFrm
{
	Q_OBJECT

public:
	Tester(QWidget *parent = 0);
	~Tester();
	void onMessage(ConnectionManager* sender, MessageArgs * args);
private slots:
	void startPublishPriceBtnClicked(bool checked=false);
	void startReceivePriceBtnClicked(bool checked=false);
	void priceTimerTimeout();
	void handleReceivedPrice(poc::entity::MarketPrice * price);
signals:
	void receivedPriceEvent(poc::entity::MarketPrice* price);
private:
	QTimer * priceTimer;
	Log4Qt::Logger* log;
	IEventAgent<MessageArgs>* eventAgent;

};

#endif // TESTER_H
